-
-
Notifications
You must be signed in to change notification settings - Fork 65
fix: Correct service principal to rds.amazonaws.com (incl China) #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Correct service principal to rds.amazonaws.com (incl China) #32
Conversation
…sal across partitions.
Co-authored-by: Bryant Biggs <[email protected]>
@bryantbiggs can we use the following approach? I think it would be much more reliable and native data "aws_region" "current" {}
data "aws_service_principal" "rds" {
service_name = "rds"
region = data.aws_region.current.region
} identifiers = [data.aws_service_principal.rds.id] I updated the code. Please take a look and let me know if that ok with you. |
…alformed policy error in China partition
yes, that looks great. minor tweak to ensure we create nothing when data "aws_region" "current" {
count = var.create ? 1 : 0
}
data "aws_service_principal" "rds" {
count = var.create ? 1 : 0
service_name = "rds"
region = data.aws_region.current[0].region
} |
done. however i did not added count to aws_region resource since its being mentioned by different resources already. I leaved it as is. |
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/service_principal
however it gives the correct suffix for China principals {
type = "Service"
identifiers = ["rds.${data.aws_service_principal.rds[0].suffix}"]
} i tested that just now and it workf flawlesly in China and in AWS partition. |
@bryantbiggs sorry i was wrong. I didnt read the resource trough data.aws_service_principal.rds[0].name i changed that. its working. please take a look when you have time. |
@bryantbiggs |
## [3.2.1](v3.2.0...v3.2.1) (2025-05-22) ### Bug Fixes * Correct service principal to rds.amazonaws.com (incl China) ([#32](#32)) ([bbbf50c](bbbf50c))
This PR is included in version 3.2.1 🎉 |
@antonbabenko thanks a lot for stepping in! |
Fixed. Hashicorp has released some changes to the Terraform Registry integration, which was not stable before and doesn't seem to be stable now either. |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
…sal across partitions.
Description
according to this nice gentelmen list i was able to find that rds service principal for china is the same as for commertial region (not sure about AWS gov tho)
Motivation and Context
policy simply not work in China because service pricipal is incorrect.
Breaking Changes
I think not since this part was unusable in China anyway.
How Has This Been Tested?
examples/*
to demonstrate and validate my change(s)examples/*
projectspre-commit run -a
on my pull request